package me.heizi.springboot.students.config

//import me.heizi.springboot.students.model.UserType
//import org.springframework.beans.factory.annotation.Autowired
//import org.springframework.context.annotation.Bean
//import org.springframework.security.authentication.AuthenticationProvider
//import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder
//import org.springframework.security.config.annotation.web.builders.HttpSecurity
//import org.springframework.security.config.annotation.web.builders.WebSecurity
//import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity
//import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter
//import org.springframework.security.core.Authentication
//import org.springframework.security.core.userdetails.UserDetailsService
//import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
//import org.springframework.security.crypto.password.PasswordEncoder
//import org.springframework.security.web.authentication.rememberme.InMemoryTokenRepositoryImpl
//import org.springframework.security.web.authentication.rememberme.PersistentTokenRepository
//import javax.servlet.http.Cookie
//import javax.servlet.http.HttpServletRequest
//import javax.servlet.http.HttpServletResponse
//
//@EnableWebSecurity
//class Security: WebSecurityConfigurerAdapter() {
//
//
////    override fun configure(auth: AuthenticationManagerBuilder) {
//////        super.configure(auth)
////        AuthenticationProvider
////        println("hello config")
////    }
//
//    override fun configure(http: HttpSecurity) = http.run {
////        super.configure(http)
//
//        authorizeRequests()
//            .antMatchers("/api/*").permitAll()
//            .anyRequest().authenticated()
//
//        csrf().disable()
//        formLogin().successHandler { httpServletRequest: HttpServletRequest, httpServletResponse: HttpServletResponse, authentication: Authentication ->
////            val token = passwordEncoder.sl
////            httpServletResponse.addCookie(Cookie("token",))
//        }
//        Unit
//    }
//
//}